import javax.swing.*;
import java.awt.*;

public class TimePanel extends JPanel {
    public static JLabel timeText;
    public static JLabel scoreText;

    public static void addScore(int score) {
        scoreText.setText((Integer.parseInt(scoreText.getText()) + score) + "");
    }

    public TimePanel() {
        //super(null);
        setLayout(new BorderLayout());
        timeText = new JLabel("000");
        timeText.setFont(new Font("Consolas", Font.PLAIN, 19 + MainFrame.WIDTH / 100));
        timeText.setForeground(Color.YELLOW);
        //timeText.setLocation(MainFrame.STEP, MainFrame.STEP);
        timeText.setSize(100, 50);

        scoreText = new JLabel("0");
        scoreText.setFont(new Font("Consolas", Font.PLAIN, 19 + MainFrame.WIDTH / 100));
        scoreText.setForeground(Color.YELLOW);
        //scoreText.setLocation(MainFrame.WIDTH - 50, MainFrame.STEP);
        scoreText.setSize(100, 0);

        add(new JPanel().add(timeText), BorderLayout.WEST);
        add(new JPanel().add(scoreText), BorderLayout.EAST);

        //setBounds(0, 0, MainFrame.WIDTH, MainFrame.WIDTH);
        //setOpaque(false);
        setPreferredSize(new Dimension(0, 28 + MainFrame.WIDTH / 100));
        setBackground(new Color(60, 71, 85));
        setBorder(BorderFactory.createEtchedBorder());
    }
}
